package chapte04.de;

class Animal17{
    public void shout(){
        System.out.println("动物叫......");
    }
}
class Dog3 extends Animal17{
    public void shout(){
        System.out.println("汪汪汪.....");
    }
    public void eat(){
        System.out.println("吃骨头.......");
    }
}
public class Example17 {
    public static void main(String[] args) {
        Animal17 a1 = new Dog3();
        System.out.println("Animal17 a1 = new Dog3() : "+(a1 instanceof Animal17));
        System.out.println("Animal17 a1 = new Dog3() : "+(a1 instanceof Dog3));
        Animal17 a2 = new Animal17();
        System.out.println("Animal17 a2 = new Animal17() : "+(a2 instanceof Animal17));
        System.out.println("Animal17 a2 = new Animal17() : "+(a2 instanceof Dog3));
    }
}
